package com.tjw.ec.upms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tjw.ec.common.core.util.PageUtils;
import com.tjw.ec.common.core.util.Query;
import com.tjw.ec.upms.api.entity.RolePermitEntity;
import com.tjw.ec.upms.dao.RolePermitDao;
import com.tjw.ec.upms.service.RolePermitService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 角色授权表;
 *
 * @author T-junwen
 * @email t-junwen@foxmail.com
 * @date 2019-07-27 16:43:31
 */
@Service("rolePermitService")
public class RolePermitServiceImpl extends ServiceImpl<RolePermitDao, RolePermitEntity> implements RolePermitService {

    @Override
    public PageUtils<RolePermitEntity> queryPage(Map<String, Object> params) {

        IPage<RolePermitEntity> page = new Query<RolePermitEntity>(params).getPage();

        QueryWrapper<RolePermitEntity> queryWrapper = new QueryWrapper<>();

        IPage<RolePermitEntity> data = baseMapper.selectPage(
                page,
                queryWrapper
        );

        return new PageUtils(data);
    }

}
